<template>
  <a-card :bordered="false">
    <a-tabs defaultActiveKey="1" @change="callback">
      <a-tab-pane tab="统计报表" key="1">
        <a-row>
          <a-col :span="10">
              <a-radio-button v-on:click="selectpro1">学生统计</a-radio-button>
              <a-radio-button v-on:click="selectpro2">教师统计</a-radio-button>
          </a-col>
          <br>
          <br>
          <bar class="statistic" title="" :dataSource="dataSource" :height="400"/>
        </a-row>
      </a-tab-pane>
    </a-tabs>
  </a-card>
</template>

<script>
  import Bar from '@/components/chart/Bar'
  import {getAction} from '@/api/manage'
  import '@/assets/less/TableExpand.less'
  import {JeecgListMixin} from '@/mixins/JeecgListMixin'

  export default {
    name: "Analysis",
    mixins: [JeecgListMixin],
    components: { Bar},
    data () {
      return {
        queryParam: {
          beginDate:'',
          overDate:''
        },
        dataSource :[
        ],
      }

    },
    methods: {
      selectpro1() {
        let url = "/smartStudent/smartStudentTeacherInfomation/tongji";
        getAction(url).then((res) => {
          if (res.success) {
            this.dataSource = res.result;
          }
        })
      },
      selectpro2(){
        let url = "/smartTeacher/smartSchoolTeacherInfomation/tongji";
        getAction(url).then((res) => {
          if (res.success) {
            this.dataSource = res.result;
          }
        })
      }
    },
    created() {
      this.selectpro1();
    }

  }
</script>